home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / byte0887.arc / LANE.ARC / MEMORY.BAS < prev    next >
BASIC Source File  |  1987-05-07  |  909b  |  26 lines

  1. 10 ' Program to create MEMORY.ARI file for Prolog program
  2. 20 '   for "Simulating a Microprocessor with Prolog"
  3. 30 '   by Alex Lane
  4. 40 '
  5. 100 OPEN "MEMORY.ARI" FOR OUTPUT AS 1
  6. 110 PRINT#1, "% File: MEMORY.ARI"
  7. 120 PRINT#1, "%  from Simulating a Microprocessor with Prolog by Alex Lane"
  8. 130 PRINT#1, "%"
  9. 140 PRINT#1, "% This file contains a predicate that initializes"
  10. 150 PRINT#1, "%   a 256-byte memory"
  11. 160 PRINT#1, "% To 'run' a program on the simulated microprocessor,
  12. 170 PRINT#1, "%   insert the appropriate machine code bytes into
  13. 180 PRINT#1, "%   the memory locations
  14. 190 PRINT#1, "%"
  15. 200 PRINT#1, "init_mem :-"
  16. 210 PRINT#1, "   asserta(top_of_memory(255)),"
  17. 220 FOR I = 0 TO 254
  18. 230   IS$ = STR$(I)
  19. 240   PRINT#1, "   assertz(memory("; IS$; ",0)),   % NOP"
  20. 250 NEXT I
  21. 260 PRINT#1, "   assertz(memory( 255,0)).   % NOP"
  22. 300 PRINT#1, "%"
  23. 310 PRINT#1, "% end"
  24. 320 CLOSE
  25. 400 END
  26.